本篇會使用 MLflow example project 來熟悉 MLflow Tracking 的基本操作。
首先,Git clone MLflow example project
git clone https://github.com/mlflow/mlflow-example.git
cd mlflow-example
裝完 pip install mlflow
之後,預備來跑看看 MLflow example project
$ mlflow run .
2023/09/22 17:10:59 INFO mlflow.utils.conda: Conda environment mlflow-2b6b69a3ea30872171ff71aee564367746fae613 already exists.
2023/09/22 17:10:59 INFO mlflow.projects.utils: === Created directory /var/folders/67/xhzg3lkj2m3_br8sdmb7ld5w0000gn/T/tmp8s17f2dq for downloading remote URIs passed to arguments of type 'path' ===
2023/09/22 17:10:59 INFO mlflow.projects.backend.local: === Running command 'source /Users/jimmy.liao/anaconda3/bin/../etc/profile.d/conda.sh && conda activate mlflow-2b6b69a3ea30872171ff71aee564367746fae613 1>&2 && python train.py 0.5 0.1' in run with ID '5eac19edecd04872af3c79d291ecb62f' ===
Elasticnet model (alpha=0.500000, l1_ratio=0.100000):
RMSE: 0.7947931019036528
MAE: 0.6189130834228137
R2: 0.1841166871822183
2023/09/22 17:11:06 INFO mlflow.projects: === Run (ID '5eac19edecd04872af3c79d291ecb62f') succeeded ===
本地端會有 mlruns 的結果資料夾,用 mlflow ui
來看看
mlflow ui
打開瀏覽器,開啟 http://127.0.0.1:5000 。可以看到 Experienments 的結果。
下一篇我們會介紹 MLflow 上 Models 的基本操作。